package com.cordershy.pojo;

import org.apache.ibatis.type.Alias;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.math.BigDecimal;

@Component
@Alias(value = "pay")
public class pay implements Comparable<pay>,Serializable {
    private int payid;
    private String payname;
    private String paydate;
    private BigDecimal pay;
    private String paymonth;
    private String payday;
    private String payyear;
    private String username;

    public pay() {
    }

    public pay(int payid, String payname, String paydate, BigDecimal pay, String paymonth, String payday, String payyear, String username) {
        this.payid = payid;
        this.payname = payname;
        this.paydate = paydate;
        this.pay = pay;
        this.paymonth = paymonth;
        this.payday = payday;
        this.payyear = payyear;
        this.username = username;
    }

    public void setPayid(int payid) {
        this.payid = payid;
    }

    public void setPayname(String payname) {
        this.payname = payname;
    }

    public void setPaydate(String paydate) {
        this.paydate = paydate;
    }

    public void setPay(BigDecimal pay) {
        this.pay = pay;
    }

    public void setPaymonth(String paymonth) {
        this.paymonth = paymonth;
    }

    public void setPayday(String payday) {
        this.payday = payday;
    }

    public void setPayyear(String payyear) {
        this.payyear = payyear;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getPayid() {
        return payid;
    }

    public String getPayname() {
        return payname;
    }

    public String getPaydate() {
        return paydate;
    }

    public BigDecimal getPay() {
        return pay;
    }

    public String getPaymonth() {
        return paymonth;
    }

    public String getPayday() {
        return payday;
    }

    public String getPayyear() {
        return payyear;
    }

    public String getUsername() {
        return username;
    }

    @Override
    public String toString() {
        return "pay{" +
                "payid=" + payid +
                ", payname='" + payname + '\'' +
                ", paydate='" + paydate + '\'' +
                ", pay=" + pay +
                ", paymonth='" + paymonth + '\'' +
                ", payday='" + payday + '\'' +
                ", payyear='" + payyear + '\'' +
                ", username='" + username + '\'' +
                '}';
    }

    @Override
    public int compareTo(com.cordershy.pojo.pay o) {
        return Integer.parseInt(o.getPayday())-Integer.parseInt(this.getPayday());
    }
}
